package cn.zust.edu.cn.pojo;

import cn.zust.edu.cn.service.IShape;

public class Rectangle implements IShape {

    Point ptTopLeft;
    Point ptTopRight;


    private int width;
    private  int height;

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public Rectangle(){

    }

    public Rectangle(Point topleft,int height,int width){
        this.ptTopLeft = topleft;
        this.width = width;
        this.height = height;
    }

//    public double  perimeter(){
//
//        return 2*(width+height);
//    }
//
//    public double  area(){
//
//        return width*height;
//    }
//
//    public void  draw(){
//        System.out.println("rectangle");
//    }

    @Override
    public double perimeter(){
        return 2*(width+height);
    }

    @Override
    public double area(){
        return width*height;
    }

    @Override
    public void draw(){
        System.out.println("rectangle");
    }


}
